import 'package:flutter/cupertino.dart';
import 'package:mobile_app.core/core/presentation/helpers/screen_util_mixin.dart';
import 'package:mobile_app.core/core/presentation/theme/theme.dart';

class TileNavigationIndicator extends StatelessWidget with ScreenUtilMixin {
  const TileNavigationIndicator({
    this.label,
    super.key,
  });

  final String? label;

  @override
  Widget build(BuildContext context) {
    Widget navigationIndicatorView = Icon(
      CupertinoIcons.forward,
      color: CoreTheme.of(context).tileNavigationIndicatorColor,
      size: 21,
    );

    if (label != null) {
      navigationIndicatorView = Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(
            label!,
            style: CoreTheme.of(context).textTheme.tileNavigationIndicatorLabel,
          ),
          navigationIndicatorView,
        ],
      );
    }

    const edgeInsets = EdgeInsets.only(
      right: 11,
      left: 8,
    );

    navigationIndicatorView = Padding(
      padding: edgeInsets,
      child: navigationIndicatorView,
    );

    return navigationIndicatorView;
  }
}
